import store from '../../store/store'
import create from '../../utils/create'
create(store, {
  data:{
    _index:{

    }
  },
  onShow() {
    this.update()
  },
  getAuth(e){
    const promise = e.detail;
    promise.then(res=>{
      this.store.data.userInfo = res.userInfo;
      this.store.data.hasAuth = true;
      this.update()
    }).catch(res=>{
      console.log('您拒绝授权',res)
    })
  },
  goDemo(){
    this.update();
    wx.navigateTo({
      url: '/pages/demo/demo',
    })
  }
})